package com.spsoft.vatoutinv.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spsoft.system.model.vo.InvoiceVo;
import com.spsoft.vatoutinv.entity.vmsfulloutinvoice.VmsFullOutInvoiceDetails;
import com.spsoft.vatoutinv.model.dto.statistics.InvoiceInfoDto;
import com.spsoft.vatoutinv.model.vo.statistics.InvoiceInfoVo;
import com.spsoft.vatoutinv.model.vo.vmsiscinformation.VmsIscInformationComVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 数电发票信息表 Mapper 接口
 * </p>
 *
 * @author chenxudong
 * @since 2023-11-30
 */
public interface VmsFullOutInvoiceDetailsMapper extends BaseMapper<VmsFullOutInvoiceDetails> {

    @Select("SELECT SEQ_VMS_FULL_OUTINVOICEDETAILS.NEXTVAL FROM DUAL")
    Long getNextSequenceValue();

    List<VmsIscInformationComVo> selectInvoiceSummary(@Param("month") String month, @Param("jyjg") String jyjg);

    int updateBatchByFphm(ArrayList<VmsFullOutInvoiceDetails> vmsFullOutInvoiceDetails);

    /**
     * 根据发票号码查询数电发票数据
     */
    InvoiceVo queryInvoice(@Param("fphm") String fphm, @Param("deptCode") String deptCode);

    /**
     * 更新发票状态、作废冲红原因、日期
     */
    int updateInvoiceFpzt(@Param("fpzt") String fpzt, @Param("zfchyy") String zfchyy,
                          @Param("zfchrq") Date zfchrq, @Param("foidid") Long foidid);

    /**
     * 查询发票信息统计
     * @param page
     * @param invoiceInfoDto
     * @return
     */
    IPage<InvoiceInfoVo> queryInvoiceInfoStatistics(@Param("page") IPage<InvoiceInfoVo> page, @Param("dto")InvoiceInfoDto invoiceInfoDto,@Param("sxjg") String[] sxjg);

}
